namespace Addressbook
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;

    public partial class Addressbook : DbContext
    {
        public Addressbook() : base("name=Addressbook")
        {
            //this.Database.Initialize(true);
        }

        public DbSet<Person> Persons {get;set;}
        public DbSet<Address> Addresses { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //this.Database.CreateIfNotExists();
            base.OnModelCreating(modelBuilder);

            //modelBuilder.Entity<Address>().
            //    Property(d => d.id).
            //    IsRequired();
        }
    }
}
